package com.dingyuhang.service.impl;


import com.dingyuhang.bean.Forum;
import com.dingyuhang.mapper.ForumMapper;
import com.dingyuhang.service.ForumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ForumServiceImpl implements ForumService {
	
	@Autowired
	private ForumMapper forumMapper;

	@Override
	public List<Forum> selectForums() {
		return forumMapper.selectForums();
	}
	
	@Override
	public int maxSortNo() {
		// TODO Auto-generated method stub
		return forumMapper.maxSortNo();
	}
	
	@Override
	public void insertForum(Forum forum) {
		forumMapper.insertForum(forum);
	}
	
	@Override
	public Forum getForumById(Integer id) {
		return forumMapper.selectForumById(id);
	}

	
	@Override
	public void updateForum(Forum forum) {
		forumMapper.updateForum(forum);
		
	}
}
